<?php
namespace app\common\model;

use think\facade\Db;
use think\Model;
class Classes extends Model
{
    //自动生成写入时间
//    protected $autoWriteTimestamp = true;

    public function classes(){
        return Db::table('classes')
            ->alias('c')
            ->join('subject s','c.subject_id = s.id')
            ->field('c.*,s.name as subject_name')
            ->select();
    }
}